http://imageshack.us/photo/my-images/560/tek0024.png/
The resistor values were chosen to intersect the sine wave at each new
phase. (R(n) = 1/sin^2(n*18degrees))
Approximate values, R0=open, R1=R9=105k, R2=R8=28.9k, R3=R7=15.3k,
R4=R6=11k, R5=10k. all 1% resistors.
Here’s the spectrum as recorded by an SRS770 spectrum analyzer.
http://imageshack.us/photo/my-images/839/stepsin.png/
The 2nd harmonic is only down by 50dB. I don’t understand why it’s so
big. Is there some way to do better than this? The 9th and 11th
harmonics are big and then the 19th and 21st.
Thanks George H.
George, I don't remember the discussion. Probably didn't
read it. But if you are using a 4017 (decade counter), then
I'm guessing that you are enabling one resistor at a time
while disabling others (they tie to the summing junction from
each, moving output pin.) This worries me a little, mostly
because of delay and the fact that you are turning off one
while turning on another, but don't control that very well. I
also don't know what you are doing to filter the steps.
Anyway, I'd have wanted to consider, instead, a Gray-coded
(actually, the real inventor is Boudot, I think, but Bell
Labs was patenting everything in a flurry in the mid 1900's
and who could remember Boudot so long ago?) design where you
only change one of the outputs at a time. Not two.
Anyway, I'll let the big hitters who probably did read the
earlier thread tell you what is more likely. Just something
that crossed my mind, is all.
Jon
Hi Jon, Thanks for that. The 4017 is just too simple! I'm hoping all
the swithing transients can just be filtered away. I put a little
tweaker pot on the smallest R5 resistor and was able to get everything
down below 60dB, so I'm thinking this is just a resistor tolerance/
selection issue.
I was just twisting different resistors together to get the
approximate values, and didn't measure any of them. I'll try really
nailing the values I want.
Oh I'll add some multi-pole low pass on the back end of this.. but
that will do nothing for the lower order harmonics.
George H.
No problem. In the interim, I did a quick search for summing
junctions and Gray codes and came up with this link:
http://www.wiseguysynth.com/larry/schematics/walsh/walsh.pdf
I have NOT read it. But it looks about right to me as a zero
order approximation to what I was thinking about. I have
never considered doing what you are doing, but your writing
sprung two things immediately to mind. One is doing Fourier
analysis (which you should have already done, I imagine) and
the other is that you are possibly changing two outputs at
once and with that plus ripple carry stuff I get kind of
worried. All this would make me want to go to theory to
calculate my expectations and make sure they matched
experience in your testing. If I can't match them up, that
means I don't know enough and need to read more.
>The 4017 is just too simple!
Yeah. And you know what that means. Things should be as
simple as needed but no more so.
>I'm hoping all
>the swithing transients can just be filtered away. I put a little
>tweaker pot on the smallest R5 resistor and was able to get everything
>down below 60dB, so I'm thinking this is just a resistor tolerance/
>selection issue.
>I was just twisting different resistors together to get the
>approximate values, and didn't measure any of them. I'll try really
>nailing the values I want.
>
>Oh I'll add some multi-pole low pass on the back end of this.. but
>that will do nothing for the lower order harmonics.
I completely understand the problem in trying to filter out
2nd harmonics from the 1st. So yeah, that's not really a
good answer. Which is why I didn't really suggest it, but
instead went to Gray codes and the like.
Check out the link and see if it triggers anything. I will
read it a little later on, it's interesting to me regardless.
But it might apply from a cursory glance at it.
Jon
>... and need to read more.
Better would be to have said, "and need to imagine, think,
and possibly read more." It does more for the soul.
Jon
If you used 1% resistors, then getting 50dB was better than expectations
(1% error is about 40dB down, and if everything adds the wrong way you'll
get at least twice that).
0.1% resistors will, in theory, get you around 60dB down.
The rule of thumb for this sort of thing is that you can really only
expect a "by the book" nulling circuit (which is what you have) to stomp
things down by about 40dB, and if you really pull out the stops and hand-
tweak things then you can maybe get 60dB -- until someone breaths.
Instrument makers _can_ do better than this, but its only "routine"
inasmuch as the methods they use (shielding, tweaking, gold plating,
1000% overbuilt circuits, "Only Bob can do that" procedures, etc.) are
routine.
We get over 60 dB in our arbs, but it's hard. We start with a 16 bit
differential current output DAC. The tough part is the downstream
amplifiers, especially past a couple of MHz.
There are major-brand RF signal generators with -20 dB harmonics.
John
Thanks Tim, I kinda figured that out on my own.
George H.
That's a feature not a bug, you get a higher frequency generator
'cause of the big 3rd harmonic. :^)
We've got this el-cheapo RF generator that even has the 3rd harmonic
frequencies listed on the dial.
George H.
>
> John- Hide quoted text -
50 dB is only 0.3%, which isn't too bad. That might easily be due to
the output impedances of the 4017 drivers, or to the resistor
tolerances. Does it get better or worse when you change VDD? If so,
it's probably the output impedance.
Cheers
Phil Hobbs
I posted this 8 years ago...
http://www.analog-innovations.com/SED/SineEqualsSumOfSquares.pdf
I also have this book...
"Sequency Theory, Foundations and Applications"
Henning F. Harmuth
Academic Press, 1977
ISBN: 0-12-014569-3
which covers Walsh Functions in gruesome detail ;-)
...Jim Thompson
--
| James E.Thompson, CTO | mens |
| Analog Innovations, Inc. | et |
| Analog/Mixed-Signal ASIC's and Discrete Systems | manus |
| Phoenix, Arizona 85048 Skype: Contacts Only | |
| Voice:(480)460-2350 Fax: Available upon request | Brass Rat |
| E-mail Icon at http://www.analog-innovations.com | 1962 |
I love to cook with wine. Sometimes I even put it in the food.
Yeah, I was thinking about the output impedance. (I didn't looked at
the outputs from the 4017). When I decreased the supply voltage the
2nd harmonic was roughly constant while everything else went down. I
added a tweaker on the lowest resistance output and got everything
below the 9th close to 60 dB down. Which is almost beer time, except
it's only at 1kHz.
George H.
>On Thu, 13 Oct 2011 10:24:17 -0700, Jon Kirwan
><jo...@infinitefactors.org> wrote:
>
>>On Thu, 13 Oct 2011 10:13:20 -0700 (PDT), George Herold
>><ghe...@teachspin.com> wrote:
>>
>>>On Oct 13, 12:59ļæ½pm, Jon Kirwan <j...@infinitefactors.org> wrote:
>>>> On Thu, 13 Oct 2011 09:39:21 -0700 (PDT), George Herold
>>>>
>>>> <gher...@teachspin.com> wrote:
>>>> >This is a continuation of the 50kHz VCO thread I started last week. ļæ½I
>>>> >tried the stepped sine wave idea as suggested by James A, and Phil
>>>> >H.
>>>> >The circuit clocks a MC14017 at 10x(F) to make a stepped sine wave at
>>>> >frequency (F). ļæ½The ten outputs from the 4017 are sent through
>>>> >appropriate resistors and into the summing junction of an opamp.
>>>> >Hereļæ½s a ļæ½scope shot of the stepped output overlaid with a sine
>>>> >wave.
>>>>
>>>> >http://imageshack.us/photo/my-images/560/tek0024.png/
>>>>
>>>> >The resistor values were chosen to intersect the sine wave at each new
>>>> >phase. ļæ½(R(n) = 1/sin^2(n*18degrees))
>>>>
>>>> >Approximate values, R0=open, R1=R9=105k, R2=R8=28.9k, R3=R7=15.3k,
>>>> >R4=R6=11k, R5=10k. ļæ½all 1% resistors.
>>>>
>>>> >Hereļæ½s the spectrum as recorded by an SRS770 spectrum analyzer.
>>>>
>>>> >http://imageshack.us/photo/my-images/839/stepsin.png/
>>>>
>>>> >The 2nd harmonic is only down by 50dB. ļæ½I donļæ½t understand why itļæ½s so
>>>> >big. ļæ½Is there some way to do better than this? ļæ½The 9th and 11th
>>>> >harmonics are big and then the 19th and 21st.
>>>>
>>>> >Thanks George H.
>>>>
>>>> George, I don't remember the discussion. ļæ½Probably didn't
>>>> read it. ļæ½But if you are using a 4017 (decade counter), then
>>>> I'm guessing that you are enabling one resistor at a time
>>>> while disabling others (they tie to the summing junction from
>>>> each, moving output pin.) ļæ½This worries me a little, mostly
>>>> because of delay and the fact that you are turning off one
>>>> while turning on another, but don't control that very well. I
>>>> also don't know what you are doing to filter the steps.
>>>>
>>>> Anyway, I'd have wanted to consider, instead, a Gray-coded
>>>> (actually, the real inventor is Boudot, I think, but Bell
>>>> Labs was patenting everything in a flurry in the mid 1900's
>>>> and who could remember Boudot so long ago?) design where you
>>>> only change one of the outputs at a time. ļæ½Not two.
>>>>
>>>> Anyway, I'll let the big hitters who probably did read the
>>>> earlier thread tell you what is more likely. ļæ½Just something
>>>> that crossed my mind, is all.
>>>>
>>>> Jon- Hide quoted text -
>>>>
>>>> - Show quoted text -
>>>
>>>Hi Jon, Thanks for that.
>>
>>No problem. In the interim, I did a quick search for summing
>>junctions and Gray codes and came up with this link:
>>
>>http://www.wiseguysynth.com/larry/schematics/walsh/walsh.pdf
>
>I posted this 8 years ago...
>
>http://www.analog-innovations.com/SED/SineEqualsSumOfSquares.pdf
>
>I also have this book...
>
>"Sequency Theory, Foundations and Applications"
>Henning F. Harmuth
>Academic Press, 1977
>ISBN: 0-12-014569-3
>
>which covers Walsh Functions in gruesome detail ;-)
I picke up Walsh's original paper (redone, actually, in Latex
and error corrected as it had a few in the original article)
from the web, today. The paper is "A Closed Set of Normal
Orthogonal Functions." I will be reading it more thoroughly
over the next couple of days. Also, already listed the above
link which is a nice, short overview with two examples in it.
Finally, there are a bevy of books (some of them nearly 1300
pages in length) on the subject regarding making and building
synthesizers. I'll be ordering a few before the end of the
week.
A whole world has opened up on this subject for me and I can
bring over Laplace and Fourier. Actually, it is almost easy
for me to see how to apply this with almost any starting wave
shape, not just sine/cosine or square wave. Which probably
isn't terribly practical, but interesting all the same. (Must
be some mathematician out there has already explored the use
of triangle, sawtooth, and pretty much any arbitrary basic
shape.)
I will read your PDF, as well. :)
Jon
So -- how easily can you filter that out? IIRC you needed a 3:1
frequency span -- can you stand having nine filters or so, and switching
between them (I suppose if you're frequency modulating the answer is
"NO!").
--
Tim Wescott
Control system and signal processing consulting
www.wescottdesign.com
Well, they come in HC too. ;)
Cheers
Phil Hobbs
--
Dr Philip C D Hobbs
Principal Consultant
ElectroOptical Innovations LLC
Optics, Electro-optics, Photonics, Analog Electronics
160 North State Road #203
Briarcliff Manor NY 10510
845-480-2058
hobbs at electrooptical dot net
http://electrooptical.net
Cool. I didn't think they made those in 'HC, but DigiKey says you're
right.
--
Cheers,
James Arthur
It's the physicist's version of the 555. ;)
The outputs are loaded. The effect of this overloading is to squish
the upper part of the waveform, distorting it. It looks like you've
tweaked values pretty optimally to compensate, but that's part-
dependent. How about multiplying all those resistances by 10?
These are the relative step-sizes you should be seeing (calculated
from your resistor values, in 'scope divisions, scaled and offset to
match the 'scope screen shot you posted):
(view in fixed font)
calc'd actual desired
0.2 0.2 0.2
1.05 1 0.93
3.15 2.9 2.82
5.47 5.2 5.17
7.22 7.05 7.07
7.8 7.8 7.8
(sequence repeats, falling)
Looks pretty good, but FWIW steps 1-9 and 3-9 look slightly mis-
matched.
--
Cheers,
James Arthur
I posted (and Google lost) a long post, the gist of which was:
(view in fixed font)
desired,
G.H. desired, scaled to George's
values theoretical 'scope actual
(volts) (volts) (div) (div)
0.000 0.000 0.2 0.2
0.093 0.079 0.93 1.0
0.323 0.287 2.82 2.8
0.577 0.545 5.17 5.2
0.768 0.753 7.07 7.05
0.832 0.832 7.8 7.8
(1rst column is the expected outputs based on your resistor values)
So, the outputs are loaded, but you've tweaked the resistors from the
reported values to compensate. That's device-dependent. Might wanna
up the resistances or switch to 'HC.
The actual waveform looks pretty good. Some of the steps look a
little mis-matched, e.g. 2-8 and 3-7
--
Cheers,
James Arthur
Oh, the single low pass has to start before the 9th harmonic of the
lowest frequency (~30kHz*) so I'm thinking around 200 kHz. The
resistors have to take care of the lower harmonics. (which is why the
2nd is so disturbing) 9 or 10, 0.1% resistors are not 'out of the
question' only ~$2 + the cost of placing them. Though 1% would be
nicer.
George H.
*the specs are still a bit fluid, which is a good thing.
The MC claims 16 MHz, and goes to 18V (it's nice running everything
off +/-15 volt supplies) Should I have ordered some HC too?
George H.
>
> Cheers
>
> Phil Hobbs
>
> --
> Dr Philip C D Hobbs
> Principal Consultant
> ElectroOptical Innovations LLC
> Optics, Electro-optics, Photonics, Analog Electronics
>
> 160 North State Road #203
> Briarcliff Manor NY 10510
> 845-480-2058
>
> hobbs at electrooptical dot nethttp://electrooptical.net- Hide quoted text -
Well, they're a fair amount faster, which means that the edge artifacts
aren't as serious, and their output resistance is less, which means that
the total resistance in each tap is more predictable.
Yes. Higher Vdd helps the CD4017 too.
There's still the idea of adding a switched-cap tracking filter,
running at 50f or 100f, etc.
--
Cheers,
James Arthur
Yeah, a switched cap filter on the back side might be cool. Then the
thing wouldn't be limited on the low frequency end. I've got some
from another project.
George H.
> --
> Cheers,
> James Arthur- Hide quoted text -
It'd be trivial to make an N-path filter following a square wave, then
a simple-minded smoothing R/C.
Hi James, Yeah I was loading down the output of the 4017. I measured
an output impedance of ~180 ohms. I put this number in and
recalcualted values, and then selected them to ~0.1% with a DMM. The
result.... I've got all the harmonics below the 9th down by ~70dB! I
don't know how repeatable the the output imedance is? I put in a few
different 4017's and say no difference, but these were all from the
same order, so...
Here's a plot from the SRS770.
http://imageshack.us/photo/my-images/7/vco2.png/
Now I've got to get it off the white proto-board and crank up the
frequency.
George H.
Hmm, not trivail for me since I have no idea what an N-path filter
is. But I'm googling...
George H.
Beautiful, and well worth the resistors, right? Compared to the cost
and complexity of extra hardware, it's a bargain.
For each half-wave, I'd analyze this as the sum of three impulses, one
inside the other, added together. The phasing and amplitude of those
impulses is critical to canceling harmonics.
.---.
.--' '--.
| |
.-' '-.
___| |___
| |
-' '-
My gut wants to say--but I'm too lazy to prove right now--that having
the same voltages repeated symmetrically on either side of each peak
is critical to harmonic rejection.
Where the voltage is unequal on either side, you introduce a new
impulse with a magnitude equal to the difference in voltages. It's
easy to *introduce* a 2nd harmonic component that way. For example,
taking the middle impulse:
.-----.
| '----.
| |
| | |
___|__________|_________|__
| |
| |
|____ |
'----'
My original thinking was to have an up/down counter, a single homemade
DAC, cycle up and down through the same (sine-weighted) values, then
invert (externally) for the negative swing. That gets you 4x as many
steps and automatic symmetry, but it's not nearly as cute as Phil's
4017.
> Now I've got to get it off the white proto-board and crank up the
> frequency.
>
> George H.
--
Cheers,
James Arthur